package org.example;

import java.io.*;
import java.util.HashMap;
import java.util.Map;

//2.2	增加个人信息(A02)
public class PostDemoA02 {

    public static void main(String[] args) {
        // 构建嵌套JSON结构
        Map<String, Object> data = new HashMap<>();
        data.put("id", "A02");
        data.put("empid", "8888");
        data.put("empname", "黄飞鸿");
        data.put("deptid", "02");
        data.put("sex", "0");
        data.put("mobile", "13566668888");

        try {
// {"data":{"empname":"黄飞鸿","empid":"8888","sex":"0","deptid":"02","mobile":"13566668888","id":"A02"},"openid":"000001","timestamp":"20250427174527"}
            String response = sendJsonPostRequest.sendJsonPostRequest(data);
            System.out.println("响应内容：\n" + response);
// {"errcode":"0","msg":"成功","data":[{"ErrCode":"0","ErrStr":""}]}
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}



